/***************************************************************************
 *   Copyright (C) 2009 by Macedo                                          *
 *   tmacedo29@gmail.com                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Library General Public License as       *
 *   published by the Free Software Foundation; either version 2 of the    *
 *   License, or (at your option) any later version.                       *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU Library General Public     *
 *   License along with this program; if not, write to the                 *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 *                                                                         *
 * 19.04.2009  Macedo: 1st Release                                         *
 *                                                                         *
 ***************************************************************************/

#include <Spades.h>


/**
  @name Spades
  
  @param par_type The type of Deck (blue, red, so on)

  @brief Constructor

  @return  -
*/
Spades::Spades(SuitColor par_type):Suit(":Spades.png", par_type)
{
  
}

/**
  @name ~Spades
  
  @param -

  @brief Destructor

  @return  -
*/
Spades::~Spades()
{

}

/**
  @name GetImageCard
  
  @param par_value The value of the card

  @brief Returns the image of a card according of <par_value>

  @return  A QImage of the Card image
*/
QImage Spades::GetImageCard(int par_value)
{
  int X, Y, Width=72, Height = 96;
  
  if (par_value > 0)
  {
    X = par_value*(Width+1) - (Width+1);
    Y = 1;

    return _AllCards->copy(X,Y,Width,Height);
  } 
  if (_Type == Suit_BLUE)
    return QImage("../data/images/back01.png");
  else if (_Type == Suit_RED)
    return QImage("../data/images/bBack02.png");

    return QImage("../data/images/back01.png");

}

